home *** CD-ROM | disk | FTP | other *** search
- global tableau, stock, cardspicked, tabcounter, supafly, reserve, spritish, points, pootimer, shit
-
- on beginSprite me
- sprite(me.spriteNum).visible = 1
- if tableau.findPos(makesymbol(throwdown(me.spriteNum))) = 0 then
- tableau.addProp(makesymbol(throwdown(me.spriteNum)), new(script("tableau object"), []))
- spritish.addProp(makesymbol(throwdown(me.spriteNum)), [])
- end if
- if tableau[makesymbol(throwdown(me.spriteNum))].cards.count = 3 then
- sprite(me.spriteNum).member = stock.cards[1].rank & "_" & stock.cards[1].suit
- stock.cards.deleteAt(1)
- tableau[makesymbol(throwdown(me.spriteNum))].addCard(new(script("card"), me.spriteNum))
- else
- tableau[makesymbol(throwdown(me.spriteNum))].addCard(script("card").rawNew())
- spritish[makesymbol(throwdown(me.spriteNum))].add(me.spriteNum)
- reserve.add(stock.cards[1])
- stock.cards.deleteAt(1)
- end if
- end
-
- on mouseDown me
- if cardspicked.count < 2 then
- if (member(sprite(me.spriteNum).memberNum).name <> "block") and (member(sprite(me.spriteNum).memberNum).name <> "backofcard") then
- if me.spriteNum = tableau[makesymbol(throwdown(me.spriteNum))].getlastcard().spnum then
- if cardspicked.findPos(tableau[makesymbol(throwdown(me.spriteNum))].getlastcard()) = 0 then
- if cardspicked.count < 1 then
- puppetSound(3, "pickcard")
- cardspicked.add(tableau[makesymbol(throwdown(me.spriteNum))].getlastcard())
- sprite(me.spriteNum).member = member(sprite(me.spriteNum).memberNum).name & "_black"
- else
- puppetSound(3, "pickcard")
- cardspicked.add(tableau[makesymbol(throwdown(me.spriteNum))].getlastcard())
- if chars(sprite(me.spriteNum).member.name, sprite(me.spriteNum).member.name.length - 6, sprite(me.spriteNum).member.name.length) <> "_black" then
- sprite(me.spriteNum).member = member(sprite(me.spriteNum).memberNum).name & "_black"
- end if
- supafly = timeout("supa").new(300, #getridof)
- end if
- end if
- else
- cardspicked.deleteAll()
- nameit = string(member(sprite(me.spriteNum).memberNum).name)
- sprite(me.spriteNum).member = chars(nameit, 1, nameit.length - 6)
- end if
- end if
- end if
- end
-
- on mouseUp
- if points = 520 then
- win = "yes"
- pootimer = timeout("time").new(150, #gotoit)
- else
- if stock.cards = 0 then
- checklose()
- end if
- end if
- checklose()
- end
-
- on checkwin
- global win
- if points >= 520 then
- win = "yes"
- pootimer = timeout("time").new(150, #gotoit)
- else
- if stock.cards = 0 then
- checklose()
- end if
- end if
- checklose()
- end
-
- on checklose me
- takec = []
- peking = []
- abor = 1
- hulio = 0
- repeat with i = 1 to tableau.count
- if tableau[i].cards.count <> 0 then
- takec.add(tableau[i].getlastcard().rank)
- end if
- end repeat
- taked = takec.duplicate()
- repeat with y in takec
- pookoo = []
- repeat with e = 1 to taked.count
- if y = taked[e] then
- pookoo.add(taked[e])
- end if
- if pookoo.count >= 2 then
- peking.add("PPP")
- end if
- end repeat
- end repeat
- if peking.count = 0 then
- win = "no"
- pootimer = timeout("time").new(150, #gotoit)
- end if
- end
-